#pragma once
#include "NaviComboBar.h"
#include "PropertiesWnd.h"
#include "NaviRes.h"

class CTNavigateDoc;
class CTNavigateView;
class CMainFrame : public CMDIFrameWndEx
{
	DECLARE_DYNAMIC(CMainFrame)
public:
	CMainFrame();

public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = NULL, CCreateContext* pContext = NULL);

public:
	virtual ~CMainFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	CMFCMenuBar			m_wndMenuBar;
	TEntTypeComboBar		m_wndEntTypeBar;
	TEntFlorComboBar		m_wndEntFlorBar;
	TNaviTBarBase<CMFCToolBar>		m_wndMainFrameBar;
	TNaviTBarBase<CMFCToolBar>		m_wndView3DBar;
	TNaviTBarBase<CMFCToolBar>		m_wndZoomBar;
	CMFCStatusBar   	m_wndStatusBar;
	CProgressCtrl   	*m_Progress;
	CPropertiesWnd  	m_wndProperties;
	NaviRes				m_NaviRes;

protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnWindowManager();
	afx_msg void OnViewCustomize();
	afx_msg LRESULT OnToolbarCreateNew(WPARAM wp, LPARAM lp);
	afx_msg void OnUpdateButtons(CCmdUI *pCmdUI);
	afx_msg void OnClose();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	DECLARE_MESSAGE_MAP()

public:
	CProgressCtrl* GetProgressPtr(CRect &rect);
	void GetProgressRect(CRect &rect);
	TTypeComboBox* GetEntTypeComboBox(){return &m_wndEntTypeBar.m_layerCombo;}
	TFlorComboBox* GetEntFlorComboBox(){return &m_wndEntFlorBar.m_layerCombo;}
	CTNavigateDoc* GetCurrentDoc();
	CTNavigateView* GetCurrentView();
	CPropertiesWnd* GetPropertyWnd(){return &m_wndProperties;}
	void DockPropertyWnd();
	const NaviRes* GetRes(){return &m_NaviRes;}
protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
};